home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / s-taspda.ads < prev    next >
Text File  |  1994-05-19  |  4KB  |  79 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --            S Y S T E M . T A S K _ S P E C I F I C _ D A T A             --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.5 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  This package contains an interface for manipulation of task specific data
  26.  
  27. package System.Task_Specific_Data is
  28.  
  29.    --  The basic approach is that for every task, there is an allocated
  30.    --  instance of the type TSD, which is a private type used to represent
  31.    --  task specific data.
  32.  
  33.    --  In the non-tasking case, there is one specific instance of the TSD
  34.    --  declared statically in this package, and initialized by the package
  35.    --  body initialization. Together with the interface mechanism provided
  36.    --  in System.Tasking_Soft_Links, this ensures that we can avoid bringing
  37.    --  in the tasking stuff unless tasking is actually active.
  38.  
  39.    --  In the tasking case, a TSD is allocated for each task, saved in the
  40.    --  TCB, and obtained by calling System.Tasking_Soft_Links.Get_TSD_Address.
  41.  
  42.    Non_Tasking_TSD : Address;
  43.    --  A pointer to the TSD allocated for the non-tasking case (this gets
  44.    --  fetched by the non-tasking case version of the Get_TSD_Address
  45.    --  routine in System.Tasking_Soft_Links.
  46.  
  47.    function  Get_Jmpbuf_Address return  Address;
  48.    procedure Set_Jmpbuf_Address (Addr : Address);
  49.    pragma Inline (Get_Jmpbuf_Address);
  50.    pragma Inline (Set_Jmpbuf_Address);
  51.    --  These routines provide a task specific address used to store the
  52.    --  address of the current longjmp/setjmp jump buffer for exception
  53.    --  management (under the current scheme which uses longjmp/setjmp)
  54.  
  55.    function  Get_GNAT_Exception return  Address;
  56.    procedure Set_GNAT_Exception (Addr : Address);
  57.    pragma Inline (Get_GNAT_Exception);
  58.    pragma Inline (Set_GNAT_Exception);
  59.    --  These routines provide a task specific address used to temporarily
  60.    --  store the address of the current exception during propagation.
  61.  
  62.    function  Get_Sec_Stack_Addr return  Address;
  63.    procedure Set_Sec_Stack_Addr (Addr : Address);
  64.    pragma Inline (Get_Sec_Stack_Addr);
  65.    pragma Inline (Set_Sec_Stack_Addr);
  66.    --  These routines provide a task specific address used to reference
  67.    --  the currently allocated secondary stack.
  68.  
  69.    function Create_TSD return Address;
  70.    --  Called from GNULLI when a new thread is created to allocate a new
  71.    --  TSD for the task an return a pointer to this allocated TSD. This
  72.    --  call also performs any required initialization of the TSD.
  73.  
  74.    procedure Destroy_TSD (TSD_Addr : Address);
  75.    --  Called from GNULLI just before a thread is destroyed to release
  76.    --  the storage for the TSD, after performing any required finalization.
  77.  
  78. end System.Task_Specific_Data;
  79.